package cn.iocoder.yudao.module.member.api.studentShow;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.member.api.studentShow.dto.StudentShowPageReqDTO;
import cn.iocoder.yudao.module.member.api.studentShow.dto.StudentShowRespDTO;
import cn.iocoder.yudao.module.member.controller.admin.studentShow.vo.StudentShowPageReqVO;
import cn.iocoder.yudao.module.member.convert.studentShow.StudentShowConvert;
import cn.iocoder.yudao.module.member.dal.dataobject.studentShow.StudentShowDO;
import cn.iocoder.yudao.module.member.service.studentShow.StudentShowService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;

import javax.annotation.Resource;

@Service
@Validated
public class StudentShowApiImpl implements StudentShowApi{

    @Resource
    private StudentShowService studentShowService;
    @Override
    public StudentShowRespDTO getStudentShow(Long id) {
        return StudentShowConvert.INSTANCE.convert1(studentShowService.getStudentShow(id));
    }

    @Override
    public PageResult<StudentShowRespDTO> getStudentShowPage(StudentShowPageReqDTO pageVO) {
        StudentShowPageReqVO studentShowPageReqVO=new StudentShowPageReqVO();
        BeanUtils.copyProperties(pageVO,studentShowPageReqVO);
        PageResult<StudentShowDO> studentShowDOPageResult=studentShowService.getStudentShowPage(studentShowPageReqVO);
        return StudentShowConvert.INSTANCE.convertPage1(studentShowDOPageResult);
    }
}
